package com.frxuexi.mynews.repository

import com.frxuexi.lib_commom.RetrofitManager
import com.frxuexi.mynews.ApiService
import com.frxuexi.mynews.entity.BaseEntity
import com.frxuexi.mynews.entity.NewsTypeEntity
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOn
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Query

class LoginRepository {
    val apiService by lazy { RetrofitManager.getRetrofit().create(ApiService::class.java) }
    fun login(body: RequestBody): Flow<BaseEntity<String>> {
        val flow = apiService.login(body)
            .flowOn(Dispatchers.IO)
        return flow

    }
}